package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MiniBannerMapper;
import com.ruoyi.system.domain.MiniBanner;
import com.ruoyi.system.service.IMiniBannerService;

/**
 * banner轮播图列Service业务层处理
 * 
 * @author duantao
 * @date 2025-09-11
 */
@Service
public class MiniBannerServiceImpl implements IMiniBannerService 
{
    @Autowired
    private MiniBannerMapper miniBannerMapper;

    /**
     * 查询banner轮播图列
     * 
     * @param id banner轮播图列主键
     * @return banner轮播图列
     */
    @Override
    public MiniBanner selectMiniBannerById(Long id)
    {
        return miniBannerMapper.selectMiniBannerById(id);
    }

    /**
     * 查询banner轮播图列列表
     * 
     * @param miniBanner banner轮播图列
     * @return banner轮播图列
     */
    @Override
    public List<MiniBanner> selectMiniBannerList(MiniBanner miniBanner)
    {
        return miniBannerMapper.selectMiniBannerList(miniBanner);
    }

    /**
     * 新增banner轮播图列
     * 
     * @param miniBanner banner轮播图列
     * @return 结果
     */
    @Override
    public int insertMiniBanner(MiniBanner miniBanner)
    {
        miniBanner.setCreateTime(DateUtils.getNowDate());
        return miniBannerMapper.insertMiniBanner(miniBanner);
    }

    /**
     * 修改banner轮播图列
     * 
     * @param miniBanner banner轮播图列
     * @return 结果
     */
    @Override
    public int updateMiniBanner(MiniBanner miniBanner)
    {
        miniBanner.setUpdateTime(DateUtils.getNowDate());
        return miniBannerMapper.updateMiniBanner(miniBanner);
    }

    /**
     * 批量删除banner轮播图列
     * 
     * @param ids 需要删除的banner轮播图列主键
     * @return 结果
     */
    @Override
    public int deleteMiniBannerByIds(Long[] ids)
    {
        return miniBannerMapper.deleteMiniBannerByIds(ids);
    }

    /**
     * 删除banner轮播图列信息
     * 
     * @param id banner轮播图列主键
     * @return 结果
     */
    @Override
    public int deleteMiniBannerById(Long id)
    {
        return miniBannerMapper.deleteMiniBannerById(id);
    }
}
